﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:InfoStrat.VE.NUI"
                    xmlns:util="clr-namespace:InfoStrat.VE.NUI.Utilities"
                    xmlns:s="http://schemas.microsoft.com/surface/2008"
                    xmlns:Interop="clr-namespace:System.Windows.Interop;assembly=PresentationCore">
    
    <Style TargetType="{x:Type local:SurfaceVEMap}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:SurfaceVEMap}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}"
                            Margin="{TemplateBinding Margin}"
                            Padding="{TemplateBinding Padding}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center">
                        <Viewbox Name="PART_viewbox"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center">
                            <Grid Width="1024"
                                  Height="768"
                                  Name="PART_hostGrid"
                                  ClipToBounds="True">
                                <Canvas Name="PART_canvasPushPin">
                                    <Image Name="PART_targetImage"
                                           Width="1024"
                                           Height="768"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center">
                                        <Image.Source>
                                            <Interop:D3DImage x:Name="PART_d3dImage" />
                                        </Image.Source>
                                    </Image>
                                    <ItemsPresenter />
                                </Canvas>
                            </Grid>
                        </Viewbox>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>